package com.vdong.data.service;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.vdong.data.model.Template;
import com.vdong.data.model.TemplateCarryMode;
import com.vdong.data.model.enums.State;

public interface TemplateService {

    Template findById(String id, String key);

    /**
     * 异常会回滚。添加中间表，返回主表
     *
     * @param templateArea
     * @return
     */
    List<TemplateCarryMode> save(List<TemplateCarryMode> templateCarryMode);

    Page<Template> findByUserId(String userId, Pageable pagebale, String key);

    Template findByUserIdAndState(String userId, State state, String key);

    TemplateCarryMode findByCitiesNameAndProvincesNameAndTemplateId(String citiesName, String provincesName,
                                                                    String userId, String key);

    int updateStatusById(String id, String key);

    int deleteById(String id, String key);
}
